<%@page import="java.util.List" %>
<%@page import="java.util.ArrayList" %>
<%@ page import="org.unicat.model.User" %>
<%@page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset = utf-8"/>
        <style text="css">
            .header {
                background-color: #f1f1f1;
                padding: 20px;
                text-align: center;
            }

            /* 导航条 */
            .topnav {
                overflow: hidden;
                background-color: #333;
                color: white;
            }

            /* 创建列 */
            .column {
                float: left;
                width: 100%;
                text-align: center;
            }

            /* 列后清除浮动 */
            .row:after {
                content: "";
                display: table;
                clear: both;
            }

            table {
                border-collapse: collapse;
            }

            table, th, td {
                border: 2px solid blue;

            }

            fieldset {
                margin: 30px auto;
                width: 300px;
                height: 200px;
                padding: 20px;
                color: blue;
                text-align: center;
            }


            label {
                display: inline-block;
                width: 60px;
                text-align: justify;
                text-align-last: justify;
                margin-right: 10px;
            }
        </style>


    </head>
    <body>

        <div class="header">
            <h2>SSM Demo</h2>
            <h2>SSM框架的学生信息管理系统</h2>
        </div>

        <div class="topnav">
            演示SSM框架的使用方法
        </div>
        <br>
        <fieldset>
            <div class="row">
                <div class="column">

                    <table align="center">
                        <tr>
                            <td>编号</td>
                            <td>用户名</td>
                            <td>密码</td>
                        </tr>
                        <c:forEach items="${user_list}" var="user">
                            <tr>
                                <td>${user.id}</td>
                                <td>${user.username}</td>
                                <td>${user.password}</td>
                            </tr>
                        </c:forEach>
                    </table>
                    <br>
                    <form name="deleteform" method="post" action="/login/delete">
                        <label>编号</label><input type="text" name="id"><input type="submit" value="删除">
                    </form>


                </div>

            </div>
        </fieldset>
        <br>
        <fieldset>
            <form name="updateform" method="post" action="/login/update">
                <p><label>编号</label><input type="text" name="id">
                <p><label>名称</label><input type="text" name="name">
                <p><label>密码</label><input type="text" name="password">
                <p><input type="submit" value="更新">
            </form>
        </fieldset>

    </body>
</html>
